<%--
  Created by IntelliJ IDEA.
  User: 86183
  Date: 2019/9/2
  Time: 11:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath(); %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<table class="result-tab" width="100%">
    <tr>
        <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
        <th>类型</th>
        <th>申请者姓名</th>
        <th>申请者账号信息</th>
        <th>寻找人姓名&nbsp;信息</th>
        <th>联系方式</th>
        <th>邮箱</th>
        <th>申请时间</th>
        <th>状态&操作</th>
    </tr >



    <c:forEach  items="${requestScope.pageInfo.list}" var="information" varStatus="stat">


        <tr>
            <td class="tc"><input name="id[]" value="59" type="checkbox"></td>
            <td>
                <c:if test="${information.lostTypeId == 1}">
                    寻家者
                </c:if>
                <c:if test="${information.lostTypeId == 2}">
                    寻亲者
                </c:if>
                <c:if test="${information.lostTypeId == 3}">
                    用户帮发
                </c:if>
            </td>
            <td>${information.contactName}</td>
            <td class="name" data-id="${information.userinfo.id}">${information.userinfo.name}</td>
            <td class="xiangqing" data-id1="${information.id}">${information.name}</td>
            <td>${information.contactNumber}</td>
            <td>${information.userinfo.email}</td>
            <td><fmt:formatDate value="${information.inputTime}" pattern="yyyy-MM-dd"/></td>
            <td>
                <c:if test="${information.enable eq true}"><已通过><a href="#" class="weitongguo" data-id3="${information.id}" style="color:red;">封停</a></c:if>
                <c:if test="${information.enable eq false}"><已审核未通过> <a href="#" class="tongguo" data-id3="${information.id}" style="color:#44FF0D;">通过</a></c:if>
                    <c:if test="${information.enable eq null}"><未审核><a href="#" class="tongguo" data-id3="${information.id}" >通过</a> <a href="#" class="weitongguo"  data-id3="${information.id}">未通过</a></c:if>
            </td>


        </tr>
    </c:forEach>

</table>

<tr>
    <div class="biankuang">

        <td colspan="7">
            <c:forEach  items="${requestScope.pageInfo.navigatepageNums}" var="i">
                <c:if test="${requestScope.pageInfo.pageNum eq i}" var="result">
                    <a href="#" id="ids" class="num pageNum" id="${i}">${i}</a>
                </c:if>
                <c:if test="${not result}" >
                    <a href="#" id="ids" class="num" id="${i}">${i}</a>
                </c:if>
            </c:forEach>
        </td>
    </div>
</tr>
<script>
    var pageNum;
    var name="${requestScope.name}";




    $.ajaxSettings.async = false;
    $(".tongguo").on("click",function () { //通过审核
        if (window.confirm("是否审核通过?")) {
            var enable=1;
            var action = "${pageContext.request.contextPath}/manage/show/verified"
            var id = $(this).data("id3");




            $.post(action,{id:id,enable:enable},function () {
                findAll();
            })

        }
    })







    $(".result-tab .name").click(function () {


        var id = $(this).data("id");
        layer.open({

            type: 2,
            title: '用户信息。',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['893px', '600px'],
            content: '<%=path%>/manage/ajaxJsp/userdetails?id='+id
        });

    })

    $(".result-tab .xiangqing").click(function () {

        var id = $(this).data("id1");

        layer.open({

            type: 2,
            title: '用户信息。',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['893px', '600px'],
            content: '<%=path%>/manage/ajaxJsp/loserdetails?id='+id
        });



    })
    $(".num").click(function () { //给页码加点击事件
        pageNum = $(this).html();
        findAll();

        return false;
    });


    function findAll() {

        var action ="${pageContext.request.contextPath}/manage/ajaxJsp/findLoserShow";

        $.post(action,{name:name,pageNum:pageNum},function (mes) {
            $("#show").html(mes);
        })

    }




</script>

